package com.my.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Service;

import com.my.entity.User;

@Service
public class UserService implements ResourceLoaderAware {
	
	/**
	 * 
	 */
	@Autowired
	private ApplicationContext ctx;
	
	private Resource file;
	

	public void add(User u) {
		System.out.println(ctx);
		System.out.println("UserService.add()");
		
		System.out.println(file.getFilename());
	}


	public ApplicationContext getCtx() {
		return ctx;
	}


	public void setCtx(ApplicationContext ctx) {
		this.ctx = ctx;
	}


	public Resource getFile() {
		return file;
	}


	public void setFile(Resource file) {
		this.file = file;
	}


	public void setResourceLoader(ResourceLoader resourceLoader) {
		System.out.println("@" + resourceLoader);
	}
}
